<?php

function reequipment_userapi_determinefrequency($args)
{
    extract($args);
    // This is extremely hackish, but it saves some time now.  We need to change it in the future to save the times 
    // in the db.
    if ($frequency == 'Daily'){
    	$due['date'] = strtotime('+1 Day'); 
    	$due['cycles'] = '';
    }
    if ($frequency == 'Weekly'){
    	$due['date'] = strtotime('+1 Week'); 
    	$due['cycles'] = '';
    }
    if ($frequency == 'Bi-Monthly'){
    	$due['date'] = strtotime('+2 Week'); 
    	$due['cycles'] = '';
    }
    if ($frequency == 'Monthly'){
    	$due['date'] = strtotime('+1 Month'); 
    	$due['cycles'] = '';
    }
    if ($frequency == 'Quarterly'){
    	$due['date'] = strtotime('+3 Months'); 
    	$due['cycles'] = '';
    }
    if ($frequency == 'Semi-Annual'){
    	$due['date'] = strtotime('+6 Months'); 
    	$due['cycles'] = '';
    }
    if ($frequency == 'Annual'){
    	$due['date'] = strtotime('+1 Year'); 
    	$due['cycles'] = '';
    }
    if ($frequency == '8000 Cycles'){
    	$due['cycles'] = $cycles + 8000;
    	$due['date'] = '';
    }
    if ($frequency == '10000 Cycles'){
    	$due['cycles'] = $cycles + 10000;
    	$due['date'] = '';
    }
    return $due;
}
?>